diff options
Diffstat (limited to 'src/routes/(app)/invoice/[id]/+layout.server.js')
| -rw-r--r-- | src/routes/(app)/invoice/[id]/+layout.server.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/routes/(app)/invoice/[id]/+layout.server.js b/src/routes/(app)/invoice/[id]/+layout.server.js index adcea6df..78d8481e 100644 --- a/src/routes/(app)/invoice/[id]/+layout.server.js +++ b/src/routes/(app)/invoice/[id]/+layout.server.js @@ -7,14 +7,13 @@ export async function load({ depends, params, url }) { let { id } = params; let invoice = await get(`/invoice?id=${id}`); - let { amount, received, pending } = invoice; + let { amount, received } = invoice; amount = parseInt(amount); - let paid = (!amount && (received || pending)) || (amount > 0 && received + pending >= amount); + let paid = (!amount && received) || (amount > 0 && received >= amount); if (paid && !url.pathname.endsWith('paid')) throw redirect(307, `/invoice/${id}/paid`); let sm = Qr.drawImg(invoice.text, { size: 300 }); - // let lg = Qr.drawImg(invoice.text, { size: 1200 }); return { id, invoice, sm, lg: sm }; } |
